<? 
	include('base.php');
	User::protect();
	$page_title = 'View/Edit Band Members';
	$section = 'band_members';
	include_class('band_members');
	include('layout/header.php');
	
	$band = new BandMemberList();
	$bandlist = $band->get_band_members();
?>

<div id="breadcrumb">
	<a href="index.php">Audition&nbsp;&#62;</a>&nbsp;<a href="band.php">Manage&nbsp;Band&nbsp;&#62;</a>&nbsp;Band Members
</div>

	<?
		if (db::isError($bandlist)) {
			$bandlist->outputList();
		} 
	?>

	<h1>band members:</h1>
	<div class="inset">
	<p>
	
	<? if (User::isAdmin()) { ?><a href="band_member_add.php">Add Band Member</a><? } ?>
	</p>
	<p>
	<table class="list" border="0" cellspacing="1" cellpadding="0">
	<tr>
		<td class="header">Name</td>
		<td class="header">Role</td>
	</tr>
	<?
	
	if (!db::isError($bandlist)) { 
		foreach ($bandlist as $bm) { 
			$bmu = $bm->getUserObject();?>
		<tr>
			<td valign="top"><a href="band_member_edit.php?id=<?=$bm->getID()?>"><?=$bmu->getFirstName()?>&nbsp;<?=$bmu->getLastName()?></a> <? if (!$bm->isActive()) { ?> <img src="images/inactive.gif" alt="Entry is Inactive" width="10" height="10" title="Entry is Inactive"><? } ?></td>
			<td valign="top" width="70%"><?=$bm->getRole()?></td>
		</tr>				
		<? }
	
	}
	
	if (count($bandlist) == 0 || db::isError($bandlist)) { ?>
		<tr>
			<td colspan="2"><strong>No band members</strong></td>
		</tr>
	<? } ?>
	</table>
	</p>		
	</div>
